package com.wpl.service.impl;

import com.wpl.bean.Workorder;
import com.wpl.bean.WorkorderExample;
import com.wpl.dao.WorkorderMapper;
import com.wpl.service.IOrderMyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *我的工单
 */
@Service
public class OrderMyServiceImpl implements IOrderMyService {

    @Resource
    private WorkorderMapper workorderMapper;

    /**
     * 获得工单
     * @param username
     * @return
     */
    @Override
    public List<Workorder> getWorkorders(String username) {

        WorkorderExample workorderExample = new WorkorderExample();
        WorkorderExample.Criteria criteria = workorderExample.createCriteria();
        criteria.andHandlepersonEqualTo(username);
        return workorderMapper.selectByExample(workorderExample);
    }
}
